package com.bafa.front.presentationbeans;

import java.util.TreeSet;

import com.bafa.services.RetrieveServices;

public class LeagueBean implements Comparable {

	
	private TreeSet teams = new TreeSet();
	private int seasonId;
	private int divisionId;
	private boolean completed;
	public boolean isCompleted() {
		return completed;
	}

	public void setCompleted(boolean completed) {
		this.completed = completed;
	}

	public LeagueBean(Integer[] teamIds, int seasonId,int divisionId,boolean completed) {
		
		for(int i=0;i<teamIds.length;i++){
			teams.add(new LeaguePositionBean(teamIds[i],seasonId));
		}
		this.seasonId=seasonId;
		this.divisionId=divisionId;
		this.completed=completed;
	}
	
	public LeagueBean(int seasonId,int divisionId,boolean completed) {
		
		this.seasonId=seasonId;
		this.divisionId=divisionId;
		this.completed=completed;
	}
	
	
	public LeaguePositionBean[] teams(){
		return (LeaguePositionBean[])teams.toArray(new LeaguePositionBean[teams.size()]);
	}
	public int compareTo(Object arg0) {
		return this.getDivisionId()-((LeagueBean)arg0).getDivisionId();
		
	}

	public int getDivisionId() {
		return divisionId;
	}

	public void setDivisionId(int divisionId) {
		this.divisionId = divisionId;
	}

	public int getSeasonId() {
		return seasonId;
	}

	public void setSeasonId(int seasonId) {
		this.seasonId = seasonId;
	}

	public TreeSet getTeams() {
		return teams;
	}

	public void setTeams(TreeSet teams) {
		this.teams = teams;
	}

}
